home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gamers Delight 2
/
Gamers Delight 2.iso
/
Aminet
/
game
/
board
/
GNUChess4_0_58.lha
/
gnuchess-4.0
/
src
/
new
/
README
< prev
next >
Wrap
Text File
|
1992-08-26
|
2KB
|
36 lines
There is a problem with the gcc 2.00 pre processor and FIONREAD
will not compile properly on gcc 2.00. If you get an error
message you may need to substitute a value for FIONREAD in
ElapsedTime. The correct line for a SunsparcOS4 is included
as a comment. cpp on 2.00 does not substitute in quotes,
sunOS cc and gcc 1.40 handle this correctly.
--- 1,28 ----
If you are using gcc (or another ANSI-compatible C compiler) to compile
gnuchess, but the standard C compiler provided on your operating system is not
ANSI-compatible, you may have problems compiling the FIONREAD ioctl in
dspcom.c. The problem occurs because older versions of the <ioctl.h> header
file took advantage of a C preprocessor feature that no longer works the same
way in ANSI C. If you have this problem, gnuchess will exit with an error
message referring to FIONREAD whenever you try to run it.
This problem is known to occur on SunOS.
If you have gcc 2.00 or later, you can work around the problem by including
the "-traditional-cpp" flag on the CFLAGS line in the gnuchess makefile. Be
sure to remove the .o files after you make this change so they get recompiled.
If you don't have gcc 2.00, various other workarounds may be possible; for
instance, you could compile a program that uses FIONREAD with the standard C
compiler for your operating system, find out what value FIONREAD reduces to,
and put this value directly into dspcom.c as a #define. For instance, the
following program will print out the correct #define:
#include <sys/ioctl.h>
#ifdef __STDC__
ERROR Compile me with a non-ANSI compiler!
#endif
main()
{
printf("#define FIONREAD 0x%x\n", FIONREAD);
}